package com.atnjupt.admin.exception;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 *  处理整个web controller的异常
 * @author Wizarder
 * @create 2021-10-18 20:58
 */
@Slf4j
@ControllerAdvice
public class GlobalExceptionHander {
    @ExceptionHandler(value = {ArithmeticException.class, NoSuchFieldException.class})
    public String handleArithException(Exception e){
        log.error("异常信息：{}",e);
        return "login";
    }
}
